package de.htw.praxisprojekt.actions;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import de.htw.praxisprojekt.LineAlgo;

public class OptionsDrawStringAction implements ActionListener{

	private LineAlgo lineAlgo;

	public OptionsDrawStringAction(LineAlgo lineAlgo){
		this.lineAlgo=lineAlgo;
	}

	public void actionPerformed(ActionEvent arg0){
		lineAlgo.getAlgoData().setStringDrawEnable(!lineAlgo.getAlgoData().isStringDrawEnable());
		lineAlgo.redrawBasic();
		if(!lineAlgo.getAlgoData().isAutoPlay())
			lineAlgo.getLineAlgorithm().play(lineAlgo.getAlgoData(),lineAlgo.getLineAlgorithm().getStepIndex());
	}
}